import {Button,Mention,Timeline,Icon,message} from 'antd';
import { inject, observer } from 'mobx-react';
import {WeaRichText} from 'ecCom';
import './style/index.css';
import * as FormUtil from "../../../util/formUtil";
const ButtonGroup = Button.Group;
import Comment from './comment/Comment';
import Log from './log/Log';

@inject('dynamicStore')
@observer
class Dynamic extends React.Component {
    constructor(props) {
		super(props);
    }
    
    componentDidMount(){
        const {init} = this.props.dynamicStore;
        const {refId} = this.props;
        init(refId);
    }

    componentWillUnmount(){
		const {componentWillUnmount} = this.props.dynamicStore;
		componentWillUnmount();
	}
	

	render() {
        const {list} = this.props.dynamicStore;
		return (
            <div className="wea-contract-dynamic-log">
                <div className="content" >
                {list.length>0?<div>
                    <Timeline>
                        {list.map(item=>{
                            if(item.id=="plan"){
                                return <Timeline.Item dot={<Icon type="pay-circle-o" style={{ fontSize: '23px',color:"#028102"}} />}> <div className="title">{item.content}</div> <div className="time">{item.occurDate}</div></Timeline.Item>;
                            }else if(item.id=="pay"){
                                return <Timeline.Item dot={<Icon type="pay-circle-o" style={{ fontSize: '23px',color:"#CD3F3D"}} />}> <div className="title">{item.content}</div> <div className="time">{item.occurDate}</div></Timeline.Item>;
                            }else if(item.id=="risk"){
                                return <Timeline.Item dot={<Icon type="exclamation-circle-o" style={{ fontSize: '23px'}} />}> <div className="title">{item.content}</div> <div className="time">{item.occurDate}</div></Timeline.Item>;
                            }else{
                                return <Timeline.Item> <div className="title">{item.content}</div> <div className="time">{item.occurDate}</div></Timeline.Item>;
                            }
                            
                        })}
                    </Timeline>
                    </div>
                    :
                    <div style={{textAlign:'center',color:'#ccc'}}>暂无数据</div>}
                    
                </div>

            </div>
        );
    };


    
}

export default Dynamic;